import { type RouteRecordRaw } from 'vue-router';

const Layout = () => import('@/layout/index.vue');

/**
 * 静态路由，有无权限均可访问
 */
export const constantRoutes: RouteRecordRaw[] = [
  {
    path: '/redirect',
    name: 'Redirect',
    component: Layout,
    meta: { hidden: true },
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import('@/views/constant/redirect/index.vue'),
      },
    ],
  },

  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/constant/login/index.vue'),
    meta: { hidden: true },
  },

  {
    path: '/',
    name: '/',
    component: Layout,
    redirect: '/dashboard',
    meta: { icon: 'homepage' },
    children: [
      {
        path: 'dashboard',
        // 用于 keep-alive 功能，需要与 SFC 中自动推导或显式声明的组件名称一致
        // 参考文档: https://cn.vuejs.org/guide/built-ins/keep-alive.html#include-exclude
        name: 'Dashboard',
        component: () => import('@/views/constant/dashboard/index.vue'),
        meta: {
          title: 'dashboard',
          icon: 'homepage',
          affix: true,
          keepAlive: true,
        },
      },
      {
        path: '401',
        name: 'Page401',
        component: () => import('@/views/constant/error/401.vue'),
        meta: { hidden: true },
      },
      {
        path: '404',
        name: 'Page404',
        component: () => import('@/views/constant/error/404.vue'),
        meta: { hidden: true },
      },
      // {
      //   path: 'profile',
      //   name: 'Profile',
      //   component: () => import('@/views/profile/index.vue'),
      //   meta: { title: '个人中心', icon: 'user', hidden: true },
      // },
      // {
      //   path: 'myNotice',
      //   name: 'MyNotice',
      //   component: () => import('@/views/system/notice/components/MyNotice.vue'),
      //   meta: { title: '我的通知', icon: 'user', hidden: true },
      // },
    ],
  },
];
